package com.neuedu.array;


/**
 * 顺序查找
 */
public class ArrayFind {


    public static void main(String[] args) {

        int ds[] = {7,9,6,2,5,1,0,3,8,4};


        System.out.println("请输入一个需要查找的数字");
        int num =  new java.util.Scanner(System.in).nextInt();

        int index = -1;
        for (int i = 0; i < ds.length; i++) {
            if(ds[i] == num){
                index = i;
                break;
            }
        }

        if(index!= -1 ){
            System.out.println("元素出现在 "+(index+1)+" 位 ");
        }else{
            System.out.println("未找到数字");
        }


        int[] sort = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };


        //二分查找






    }


}
